<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script type="text/javascript" src="http://libs.baidu.com/jquery/2.0.0/jquery.js"></script>
        <link rel="stylesheet" type="text/css" href="__STATIC__/admin/css/app.css" />
        <style type="text/css">  
            .text{
                text-align:center;
                text-align:right;
            }
            body{width:800px;margin:0px auto}
            #box{
                width:900px;
            }
            #left{
                width:150px;
                height:150px;
                background-color:blue;
                border:1px dotted;
                float:left;
            }
            #main{
                width:150px;
                height:152px;
                background-color:red;
                border:1px dotted;
            float:left

            }
            #right{
                width:150px;
                height:150px;

                border:1px dotted;
            float:left
        </style>
    </head>
    <body>
        <script type="text/javascript">
            function statusAction(sid){
                $.get("/index/user/disableOrEnable?sid="+sid,function(ret){
                    if(!ret.code){
                        window.location.href = window.location.href;
                        layer.msg(ret.msg);
                    }
                    else{
                        layer.msg(ret.msg);
                    }
                });
            }
            function updateAction(sid){
                window.location.href = "/index/user/showOne?sid="+sid;
            }
        </script>
        <div id="box" style="margin-top:60px">
            <h2 style="text-align: center">用户账号列表</h2>
            <h3><a href="/index/user/showOne" >新增用户</a></h3>
        <div>
            <table border="1" cellspacing="0" cellpadding="0" style="text-align:center;margin-top:15px">
                    <tr bgcolor="#88C1C8" style="height: 30px">
                        <th width='70px'>编号</th>
                        <th width='70px'>姓名</th>
                        <th width='90px'>性别</th>
                        <th width='90px'>手机号码</th>
                        <th width='70px'>状态</th>
                        <th width='70px'>权限</th>
                        <th width='150px'>最近登陆时间</th>
                        <th colspan="2" width='240px'>操作</th>
                    </tr>
                    {if isset($users)}
                    {volist name="users" id="vo"}
                        <tr style="height: 40px">
                            <td id="{$vo.sid}">{$vo.sid}</td>
                            <td>{$vo.name}</td>
                            <td>{$vo.gender}</td>
                            <td>{$vo.mobile}</td>
                            <td>{$vo.status}</td>
                            <td>{$vo.role==1?'超级管理员':'普通管理员'}</td>
                            <td>{$vo.gentime}</td>
                            <td width='120px'>
                                <input type="button" onclick="statusAction({$vo.sid})" value="启用/停用"/>
                            </td>
                            <td>
                                <input type="button" onclick="updateAction({$vo.sid})" value="&nbsp;&nbsp;编辑&nbsp;&nbsp;"/>
                            </td>
                        </tr>
                    {/volist}
                    {else /}
                    <tr style="height: 40px"><td colspan="7">没有数据</td></tr>
                    {/if}
            </table>
        </div>
        </div>
    </body>
</html>
